
package com.tz.tzgw.pc.web.dao;

import com.tz.tzgw.pc.web.model.MemberRole;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;

public class MemberRoleDao {
    private final JdbcTemplate jdbcTemplate;

    public MemberRoleDao(JdbcTemplate jdbcTemplate) {
        this.jdbcTemplate = jdbcTemplate;
    }

    public MemberRole getRoleIdByMemberId(Long member_id) {
        String sql = "SELECT role_id FROM tz_member_role WHERE member_id = ?";
        return jdbcTemplate.queryForObject(sql, new Object[]{member_id}, new BeanPropertyRowMapper<>(MemberRole.class));
    }
}
